/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mvp.levelup.unittest;

/**
 *
 * @author WORKSPOT2
 */
public class Calculator
{

    public double calc(String action, double arg1, double arg2)
    {
        if (action.equals("+"))
        {
            return arg1 + arg2;
        }
        else if (action.equals("-"))
        {
            return arg1 - arg2;
        }
        else if (action.equals("*"))
        {
            return arg1 * arg2;
        }
        else if (action.equals("/"))
        {
            return arg1 / arg2;
        }
        else
        {
            throw new IllegalArgumentException("Bad action!");
        }
    }
}
